
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>necrophilia.helpers.Callback</title>
<link rel="stylesheet" type="text/css" href="candydoc/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]-->
<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("necrophilia.helpers.Callback", "candydoc/");</script>
	<table class="content">
		<tr><td id="docbody"><h1>necrophilia.helpers.Callback</h1><!-- Generated by Ddoc from C:\Projects\necrophilia\necrophilia\helpers\Callback.d -->
<br><br>

<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">struct 
<span class="currsymbol">Callback</span>
<script>explorer.outline.addDecl('Callback');</script>

(Returns,T...);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Helper template building structure, that can store either a delegate
	or a function. It can be used, to improve a flexibility. So we han
	set function/delegate to profile something without overthrowing
	what form should it take.
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns</td>

               
<td>is a type stored function or delegate will return
	T...= are args of function/delegate</td></tr>
</table><br>
<b>Examples:</b><br>
Let's say we want our 
<span class="currsymbol">Callback</span>
<script>explorer.outline.addDecl('Callback');</script>

 to hold:
	void function/delegate (int,float)
<pre class="d_code">	<font color=blue>void</font> test(<font color=blue>int</font> a, <font color=blue>float</font> b){
		<font color=green>// something
</font>	}

	<font color=blue>alias</font> <u>Callback</u>!(<font color=blue>void</font>, <font color=blue>int</font>, <font color=blue>float</font>) myCallback;
	myCallback c;
	c.set(&amp;test);
	c.call(1,0.2);
</pre>
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">set</span>
<script>explorer.outline.addDecl('set');</script>

(Returns(* <span class="funcparam">func</span>)(T));
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Sets callback as a function
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns(* <span class="funcparam">func</span>)(T)</td>

               
<td>pointer to a function which should be called when colling callback</td></tr>
</table><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">set</span>
<script>explorer.outline.addDecl('set');</script>

(Returns delegate(T) <span class="funcparam">del</span>);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Sets callback as a delegate
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns delegate(T) <span class="funcparam">del</span></td>

               
<td>pointer to a delegate which should be called when colling callback</td></tr>
</table><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">Returns 
<span class="currsymbol">call</span>
<script>explorer.outline.addDecl('call');</script>

(T <span class="funcparam">args</span>);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Calls function/delegate
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">T <span class="funcparam">args</span></td>

               
<td><span class="funcparam">args</span> you would normally put inside function/delegate</td></tr>
</table><br>
<b>Returns:</b><br>
what would normally function/delegate return
<br><br>
<b>Throws:</b><br>
CallbackException when Callback was not set
	
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">struct 
<span class="currsymbol">InterpolationCallback</span>
<script>explorer.outline.addDecl('InterpolationCallback');</script>

(Returns,T,I);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>A bit profiled Callback to store more sofisticated functions/delegates
	used for interpolation. Those functions are normally done like
	DataType function (TimeType, DataType[] ...);
	So such things are produced by 
<span class="currsymbol">InterpolationCallback</span>
<script>explorer.outline.addDecl('InterpolationCallback');</script>

 (impossible
	to do with normaln callback).
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns</td>

               
<td>is a type stored function or delegate will return</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">T</td>

               
<td>first callback papram (TimeType from example)</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">I</td>

               
<td>DataType from example</td></tr>
</table><br>
<b>Examples:</b><br>
Let's look at a simple examle
<pre class="d_code">	<font color=blue>class</font> Foo {
		<font color=blue>int</font> test(<font color=blue>float</font> ble, <font color=blue>int</font>[] s...){
			<font color=blue>assert</font>(ble==0.f);
			<font color=blue>int</font> result;
			<font color=blue>foreach</font>(a;s){
				result+=a;
			}
			<font color=blue>return</font> result;
		}
	}

	<font color=blue>alias</font> <u>InterpolationCallback</u>!(<font color=blue>int</font>, <font color=blue>float</font>, <font color=blue>int</font>) myCallback;
	myCallback c;
	Foo foo= <font color=blue>new</font> Foo();
	c.set(&amp;foo.test);
	<font color=blue>assert</font>(c.call(0.f, 1,2,3)==6);
</pre>

<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">set</span>
<script>explorer.outline.addDecl('set');</script>

(Returns(* <span class="funcparam">func</span>)(T, I[]...));
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Sets callback as a function
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns(* <span class="funcparam">func</span>)(T, I[]...)</td>

               
<td>pointer to a function which should be called when colling callback</td></tr>
</table><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">set</span>
<script>explorer.outline.addDecl('set');</script>

(Returns delegate(T, I[]...) <span class="funcparam">del</span>);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Sets callback as a delegate
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">Returns delegate(T, I[]...) <span class="funcparam">del</span></td>

               
<td>pointer to a delegate which should be called when colling callback</td></tr>
</table><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">Returns 
<span class="currsymbol">call</span>
<script>explorer.outline.addDecl('call');</script>

(T <span class="funcparam">arg</span>, I[] <span class="funcparam">args</span>...);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Calls function/delegate
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">I[] <span class="funcparam">args</span></td>

               
<td><span class="funcparam">args</span> you would normally put inside function/delegate</td></tr>
</table><br>
<b>Returns:</b><br>
what would normally function/delegate return
<br><br>
<b>Throws:</b><br>
CallbackException when Callback was not set
	
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</td></tr>
		<tr><td id="docfooter">
			Page was generated with
			<img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px">
			on Wed Mar 21 02:44:07 2007

		</td></tr>
	</table>
</div>
<script>
   explorer.packageExplorer.addModule("necrophilia.Exception");
   explorer.packageExplorer.addModule("necrophilia.Time");
   explorer.packageExplorer.addModule("necrophilia.helpers.Callback");
   explorer.packageExplorer.addModule("necrophilia.helpers.Interpolation");
   explorer.packageExplorer.addModule("necrophilia.helpers.ListArray");
   explorer.packageExplorer.addModule("necrophilia.animation.Base");
   explorer.packageExplorer.addModule("necrophilia.animation.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.animation.Instance");
   explorer.packageExplorer.addModule("necrophilia.animation.Inteligent");
   explorer.packageExplorer.addModule("necrophilia.skeleton.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Bone");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Skeleton");</script>
</body></html>


